Skip to content

fix(remote-input): 开关已开时启动也要拉起局域网服务 - #1002

Open
zhou-zhichao wants to merge 2 commits into
Open-Less:betafrom
zhou-zhichao:fix/remote-input-start-on-launch
Open

fix(remote-input): 开关已开时启动也要拉起局域网服务#1002
zhou-zhichao wants to merge 2 commits into
Open-Less:betafrom
zhou-zhichao:fix/remote-input-start-on-launch

Conversation

@zhou-zhichao

@zhou-zhichao zhou-zhichao commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • 远程输入只在设置开关/端口变化时 refresh_remote_server。启动时即使 remoteInputEnabled 已是 true,8443 也不会监听。
  • 用户看到开关开着,但没有访问网址和配对码,手机打不开页面。
  • 启动时放到 RunEvent::Ready 再 refresh,避免 Windows 上 setup 阶段的异步任务还没跑起来就被丢掉。
  • Windows 上枚举网卡 / 调 Tauri path API 会卡住(NordVPN / QuickFox 等),PIN 和证书改到 spawn_blocking,局域网 IP 用 UDP 路由探测,不再走 list_afinet_netifas
  • 设置页一挂载就会同步调用 set_remote_locale;这里再 run_on_main_thread 刷托盘会和 WebView 互相等,窗口变成「未响应」。语言同步只改 locale,不再刷托盘。

Test plan

  • 打开远程输入,确认出现访问网址和配对码
  • 完全退出再打开 OpenLess,开关仍开时 8443 自动在听,网址还在
  • 关掉开关后重启,服务不再监听
  • Windows 进设置不再未响应(尤其装了 VPN 时)
  • 同一局域网手机能打开页面并配对录音

Toggling the setting only refreshed the server on a prefs change. After restart the switch stayed on but port 8443 never bound, so the phone page could not open.
On Windows, NIC enumeration and Tauri path APIs from the async runtime can stall the LAN server, and set_remote_locale's main-thread tray refresh deadlocks the settings page. Start the server on Ready and keep those calls off the UI thread.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant